These examples would be clearer in a namespace#85
Open
timothymcmackin wants to merge 1 commit intorinderknecht@new_jsligofrom
Open
These examples would be clearer in a namespace#85timothymcmackin wants to merge 1 commit intorinderknecht@new_jsligofrom
timothymcmackin wants to merge 1 commit intorinderknecht@new_jsligofrom
Conversation
EduardoRFS
reviewed
Aug 4, 2025
Comment on lines
+2
to
+3
| type storage_type = int | ||
| type return_type = operation list * storage_type |
Contributor
There was a problem hiding this comment.
Why are we doing the type x_type thing?
Contributor
Author
There was a problem hiding this comment.
I usually do that to distinguish types from values. Otherwise statements like storage: storage = ... can get confusing.
EduardoRFS
requested changes
Aug 4, 2025
| [], store + value | ||
|
|
||
| [@entry] | ||
| let increment (delta : int) (store : storage) : ret = [], store + delta |
Contributor
There was a problem hiding this comment.
the previous names seems better overall, increment, decrement and delta vs add, sub and value.
EduardoRFS
reviewed
Aug 4, 2025
| @@ -1,15 +1,18 @@ | |||
| type storage = int | |||
| module Counter = struct | |||
Contributor
There was a problem hiding this comment.
Also, why the module wrapper?
Contributor
Author
There was a problem hiding this comment.
For consistency with the JsLIGO example? I suppose it's not necessary here except that devs probably put most contracts in a module. If you think it's distracting I'll take it out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think these should be in a namespace/struct for clarity. In the case of jsligo it's necessary to know whether the
@entryannotation should be in a comment or not.